<template>
  <view class="u-content">
    <div class="title">{{ code }}</div>
    <u-cell-group>
      <u-cell-item v-for="item in list" :title="item.name" @click="toRoute(item.id)"></u-cell-item>
    </u-cell-group>
  </view>
</template>

<script>
export default {
  name: "LegalHubDetail",
  data() {
    return {
      list: {},
      code: ''
    }
  },
  onLoad({ code }) {
    this.code = code
    this.$api.getLegalHubList(code).then(res => {
      if (res.length) {
        this.list = res
      }
    })
  },
  methods: {
    toRoute(id) {
      this.$u.route({
        type: 'navigateTo',
        url: '/pages/LawKnow/LegalHubDetail?id=' + id
      })
    }
  }
}
</script>

<style scoped>
.title {
  font-size: 28rpx;
  height: 36rpx;
  line-height: 36rpx;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}
.u-content {
  padding: 20rpx;
}
</style>
